<?php
/*
 **************************************************************************************************
 *	Remove unnecessary code from wp_head
 **************************************************************************************************
*/
// removes the really simple discovery link
remove_action( 'wp_head', 'rsd_link' );
// removes the windows live writer link
remove_action( 'wp_head', 'wlwmanifest_link' );
// removes the wordpress version
remove_action( 'wp_head', 'wp_generator' );
// removes the rss feeds remember to add post feed maunally (if required) to header.php
remove_action( 'wp_head', 'feed_links' );
// removes all other rss links
remove_action( 'wp_head', 'feed_links_extra' );
// removes the index page link
remove_action( 'wp_head', 'index_rel_link' );
// removes the random post link
remove_action( 'wp_head', 'start_post_rel_link' );
// removes the parent post link
remove_action( 'wp_head', 'parent_post_rel_link' );
// removes the next and previous post links
remove_action( 'wp_head', 'adjacent_posts_rel_link' );

/*
 **************************************************************************************************
 *	Set up theme defaults and registers support for various wordpress features
 **************************************************************************************************
*/
function prototype_setup() {

	// make theme available for translation
	// translations can be added to the /languages/ directory
	load_theme_textdomain( TEXTDOMAIN, get_template_directory() . '/languages' );

	// adds RSS feed links to <head> for posts and comments
	add_theme_support( 'automatic-feed-links' );

	// this theme supports all available post formats by default
	add_theme_support( 'post-formats', array(
		'aside', 'audio', 'chat', 'gallery', 'image', 'link', 'quote', 'status', 'video'
	) );

	// this theme uses a custom image size for featured images, displayed on standard posts and pages
	add_theme_support( 'post-thumbnails' );

	// switches default core markup for search form, comment form, and comments to output valid HTML5
	//add_theme_support( 'html5', array( 'search-form', 'comment-form', 'comment-list' ) );

	// register a navigation menu for a theme (appearance -> menus)
	register_nav_menus( array(
		'primary-nav' => __( 'Primary Navigation', TEXTDOMAIN ),
		'secondary-nav' => __( 'Secondary Navigation', TEXTDOMAIN )
	) );

}

// called during each page load, after the theme is initialiazed
add_action( 'after_setup_theme', 'prototype_setup' );